/*
 * @Date: 2023-03-11 20:30:41
 * @LastEditors: Zireael 1193875164@qq.com
 * @LastEditTime: 2023-03-11 20:36:27
 * @FilePath: \A19\backend\src\api\Experiment\ApiEndEdit.ts
 */
import { ApiCall } from "tsrpc";
import { ReqEndEdit, ResEndEdit } from "../../shared/protocols/Experiment/PtlEndEdit";
import { Global } from '../../Global/index';

export default async function (call: ApiCall<ReqEndEdit, ResEndEdit>) {
    // TODO
    const { _id,name,startTime,endTime,language,questions } = call.req
    await Global.collection('experiments').updateOne({
        _id
    },{
        name,
        startTime,
        endTime,
        language,
        questions
    })

    call.succ({})
}